package org.particlethink.entry;

public enum BillStatus implements IntEnum {
    UnConfirmed(1),//待确认
    Objection(2),//供应商异议 由供应商提出异议，对对账单退回；或项目方主动撤回
    Confirmed(3),//已确认
    Discard(4);//已作废 供应商异议后，项目方进行作废处理


    private final int code;

    BillStatus(int code) {
        this.code = code;
    }


    public int getCode() {
        return code;
    }

    public static BillStatus fromCode(Integer code) {
        if (code == null) {
            return null;
        }
        switch (code) {
            case 1:
                return UnConfirmed;
            case 2:
                return Objection;
            case 3:
                return Confirmed;
            case 4:
                return Discard;
            default:
                return null;
        }
    }

    public String toString() {
        switch (this) {
            case UnConfirmed:
                return "待确认";
            case Objection:
                return "供应商异议";
            case Confirmed:
                return "已确认";
            case Discard:
                return "已作废";
            default:
                return "";
        }
    }
}

